USE [ERP]
GO

/****** Object:  Table [dbo].[EmployeeHobbies]    Script Date: 11/16/2009 14:31:36 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[EmployeeHobbies](
	[EmployeeID] [nvarchar](50) NOT NULL,
	[HobbyID] [nvarchar](50) NOT NULL,
	[RepeatingFrequencyID] [nvarchar](50) NULL,
	[Notes] [nvarchar](50) NULL,
 CONSTRAINT [PK_EmployeeHobbies] PRIMARY KEY CLUSTERED 
(
	[EmployeeID] ASC,
	[HobbyID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[EmployeeHobbies]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeHobbies_Employees] FOREIGN KEY([EmployeeID])
REFERENCES [dbo].[Employees] ([ID])
GO

ALTER TABLE [dbo].[EmployeeHobbies] CHECK CONSTRAINT [FK_EmployeeHobbies_Employees]
GO

ALTER TABLE [dbo].[EmployeeHobbies]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeHobbies_Hobbies] FOREIGN KEY([HobbyID])
REFERENCES [dbo].[Hobbies] ([ID])
GO

ALTER TABLE [dbo].[EmployeeHobbies] CHECK CONSTRAINT [FK_EmployeeHobbies_Hobbies]
GO

ALTER TABLE [dbo].[EmployeeHobbies]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeHobbies_RepeatingFrequencies] FOREIGN KEY([RepeatingFrequencyID])
REFERENCES [dbo].[RepeatingFrequencies] ([ID])
GO

ALTER TABLE [dbo].[EmployeeHobbies] CHECK CONSTRAINT [FK_EmployeeHobbies_RepeatingFrequencies]
GO

